﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MyabpDDD.Demo.Application.LinemanagementtableLy;
using MyabpDDD.Demo.Application.LinemanagementtableLy.Dto;
using MyCompany.MyProject.Models;
using System.Threading.Tasks;

namespace MyabpDDD.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class XIanluController : ControllerBase
    {
        private static readonly string[] Summaries = new[]
        {
            "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
        };
        private readonly ILinemanagementtableLyService _service;
        public XIanluController(ILinemanagementtableLyService service)
        {
            this._service = service;
        }
        [HttpGet]
        public ActionResult QueryStudentAll(int pageIndex, int pageSize, string xianname, string qidian, string zhundian, string shifou, string phone, string danwei)
        {
            var list = _service.QueryStudentAll(pageIndex, pageSize, xianname, qidian, zhundian, shifou, phone, danwei);
            return Ok(list);
        }
        [HttpPost]
        public async Task<Linemanagementtable> Inser(LinemanagementtableLyDto dto)
        {
            return await _service.Inser(dto);
        }
        [HttpGet]
        public async Task Delete(int id)
        {
            await _service.Delete(id);
        }
        [HttpGet]
        public ActionResult Get(int id)
        {
            return Ok(_service.Get(id));
        }
        [HttpGet]
        public ActionResult SelectDel(string ids)
        {
            return Ok(_service.SelectDel(ids));
        }
    }
}
